#pragma once

#include "processor.h"
#include "memory.h"
#include <vector>
#include <fstream>
#include <cstring>
#include <cstdlib>
#include <iostream>

struct fHeader
{
    char magic[8];
    char version[4];
    word fType;
    word pCount;
    dword fEntry;
    dword fSize;
    qword mEntry;
};
struct pHeader
{
    qword pEntry;
    byte pType;
    byte phLength;
    word plLength;
    // 24bit page length,but dispatched to make struct packed.
    dword fBegin;
};

static fHeader fMessage;
static std::vector<pHeader> pMessage;

void getHeader(const char *filename);
void getPage(const char *filename);
void loadImage(const char *filename);
